Skip to content

Conversation

@shsms
Copy link
Contributor

@shsms shsms commented May 14, 2025

It is useful as a place-holder receiver for use in contexts where a receiver is necessary, but one is not available.

shsms added 4 commits May 14, 2025 14:49
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Copilot AI review requested due to automatic review settings May 14, 2025 13:12
@shsms shsms requested a review from a team as a code owner May 14, 2025 13:12
@shsms shsms requested a review from Marenz May 14, 2025 13:12
@github-actions github-actions bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests part:experimental Affects the experimental package labels May 14, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new experimental NopReceiver that acts as a place‐holder receiver, along with updates to tests and deprecation of OptionalReceiver.

  • Updated tests across multiple modules to use asynchronous closing via aclose().
  • Added a new experimental NopReceiver and its corresponding tests.
  • Deprecated OptionalReceiver and updated the export order in the experimental module.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_merge_integration.py Replaced synchronous close() calls with asynchronous aclose() calls in channel handling.
tests/test_broadcast.py Updated broadcast channel closing to use aclose() consistently.
tests/test_anycast.py Updated anycast channel closing to use aclose() consistently.
tests/experimental/test_nop_receiver.py Added tests to verify the behavior of the new NopReceiver.
src/frequenz/channels/experimental/_optional_receiver.py Deprecated OptionalReceiver with a recommendation to use NopReceiver instead.
src/frequenz/channels/experimental/_nop_receiver.py Introduced the new NopReceiver implementation that never receives a message.
src/frequenz/channels/experimental/init.py Updated the module exports to include NopReceiver and reposition WithPrevious for clarity.
RELEASE_NOTES.md Documented the new NopReceiver feature and migration notes for OptionalReceiver deprecation.

from ._with_previous import WithPrevious

__all__ = [
"NopReceiver",
Copy link

Copilot AI May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider sorting the all list alphabetically to improve readability and maintainability.

Copilot uses AI. Check for mistakes.
@shsms
Copy link
Contributor Author

shsms commented May 14, 2025

Can drop the deprecation commit, if you want to postpone it.

@shsms shsms enabled auto-merge May 14, 2025 13:15

@override
async def ready(self) -> bool:
"""Wait for ever unless the receiver is closed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forever

@shsms shsms added this pull request to the merge queue May 14, 2025
Merged via the queue into frequenz-floss:v1.x.x with commit f5a4981 May 14, 2025
5 checks passed
@shsms shsms deleted the nop-receiver branch May 14, 2025 14:15
Copy link
Contributor

@llucax llucax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I suggested this name, but recently I needed something similar for a context manager and bumped into nullcontext, so maybe NullReceiver could be more familiar to python users.

But just an idea, I think the gain, if any, is marginal anyways...

@llucax llucax added this to the v1.9.0 milestone Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation part:experimental Affects the experimental package part:tests Affects the unit, integration and performance (benchmarks) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants